﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace MarqueeMoment
{
    public partial class ScheduleControl : UserControl
    {
        Int32 _recordId = 0;
        bool isParentArchive = false;
        public ScheduleControl(Int32 recordId)
        {
            InitializeComponent();
            _recordId = recordId;
        }

        public ScheduleControl(Int32 recordId,bool fromArchive)
        {
            InitializeComponent();
            _recordId = recordId;
            isParentArchive = fromArchive;
        }

        private void btnDelete_Click(object sender, EventArgs e)
        {
            if (!isParentArchive)
            {
                frmMainMenu form = (frmMainMenu)this.Parent.Parent;
                form.buttonDeleteClick(sender, e, _recordId);
            }
        }

        private void btnReschedule_Click(object sender, EventArgs e)
        {

            if (!isParentArchive)
            {
                frmMainMenu form = (frmMainMenu)this.Parent.Parent;
                form.buttonRescheduleClick(sender, e, _recordId);
            }
            else
            {
                MarqueeMoment.Forms.frmArchive form = (MarqueeMoment.Forms.frmArchive)this.Parent.Parent;
                form.buttonScheduleClick(sender, e, _recordId);            
            
            }
        }
    }
}
